<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>登陆页面</title>
    <script src="../../resources/app/all.js" type="text/javascript"></script>
    <style type="text/css">
        body {
            background: url("../../resources/images/bj.jpg") no-repeat;
        }

        .layout-panel-east, .layout-panel-east .panel-body {
            background: transparent url("../../resources/images/login-wrap-bg.png") repeat;
        }

        .title {
            color: #fff;
            font-size: 34px;
            font-weight: bolder;
            text-align: center;
            margin-bottom: 60px
        }

        .divider {
            color: #a8a8a8;
            background: #a8a8a8
        }

        #loginForm {
            height: 500px;
            width: 480px;
            position: absolute;
            top: 50%;
            left: 50%;
            -webkit-transform: translate(-50%, -50%);
            transform: translate(-50%, -50%);
            -webkit-transform: translate(-50%, -50%);
        }

        .layui-card {
            border-radius: 8px;
        }

        .layui-card-body {
            padding: 18px 0px
        }

        .input-group {
            padding: 0px 18px
        }

        .input-group-addon, .input-group .form-control {
            border-width: 0
        }

        .form-control {
            height: 40px;
            font-size: 22px;
            font-family: "Verdana";
        }

        .form-control, .form-control:focus {
            box-shadow: none;
        }

        .input-group-addon {
            background: none;
            font-size: 28px
        }

        .checkbox {
            border-color: #1875f0
        }

        .textbox-label {
            color: #fff
        }
    </style>
    <script type="text/javascript">
        layui.use(['element', 'layer'], function () {
            var element = layui.element
                , layer = layui.layer;

        });

        function login() {
            var $form = $("#loginForm");
            var isValid = $form.form('validate');
            if (isValid) {
                $.ajax({
                    url: global.api_url + '/admin/home/login',
                    type: 'POST',
                    data: $form.serialize(),
                    cache: false,
                    async: true,
                    success: function (obj) {
                        if (obj && obj.code === '00') {
                            store.clear();
                            store.set('user', obj.data);
                            location.href = '/develop/admin/home/index.html';
                        } else {
                            layer.alert(obj.msg,{icon:5});
                        }
                    },
                    error: function (obj, xhr) {
                        layer.alert(obj,{icon:5});
                    }
                });
            } else {
                return false;
            }
            return false;
        }
    </script>

</head>
<body class="easyui-layout" data-options="fit:true">
<div data-options="region:'east',border:false,width:'540'">
    <form id="loginForm" class="easyui-form">
        <div class="login-box">
            <h1 class="title">系統登陸界面</h1>
            <div class="layui-card">
                <div class="layui-card-body">
                    <div class="form-group has-feedback">
                        <label class="control-label sr-only">用户名</label>
                        <div class="input-group">
                            <span class="input-group-addon iconfont icon-user"></span> <input
                                type="text" class="form-control easyui-validatebox"
                                data-options="required:true,missingMessage:'请输入用户名'" name="account"
                                placeholder="输入用户名"/>
                        </div>
                    </div>
                    <hr class="divider"/>
                    <div class="form-group has-feedback">
                        <label class="control-label sr-only">密码</label>
                        <div class="input-group">
                            <span class="input-group-addon iconfont icon-lock"></span> <input type="password"
                                                                                              class="form-control easyui-validatebox"
                                                                                              name="password"
                                                                                              data-options="required:true,missingMessage:'请输入密码'"
                                                                                              placeholder="请输入密码"/>
                        </div>
                    </div>
                    <!-- <div class="alert alert-danger alert-dismissible" role="alert"
                          th:if="${error!=null}" th:text="${error}"></div>-->
                </div>
            </div>
            <div class="form-group">
                <input class="easyui-checkbox" name="rememberMe" type="checkbox"
                       data-options="labelPosition:'after',label:'自动登录'"/>
            </div>
            <div class="form-group">
                <button class="btn btn-primary btn-lg btn-block"
                        style="background: #1875f0; border: none; padding: 16px 0px; font-size: 18px" onclick="login()">
                    登录系统
                </button>
            </div>

        </div>
    </form>
</div>
</body>
</html>